﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="MainMenu.aspx.cs" Inherits="Manager_MainMenu" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Administrator</title>
    <link href="../Pub/Css/BodyStyles.css" rel="stylesheet" type="text/css" />

    <script src="../Pub/Js/JQ/jquery-1.4.2.min.js" type="text/javascript"></script>

    <script type="text/javascript" src="<%= ResolveClientUrl("~/")%>Pub/Js/JQ/prototype.js"></script>

    <script type="text/javascript" src="<%= ResolveClientUrl("~/")%>Pub/Js/JQ/aptabs.js"></script>

    <link rel="stylesheet" type="text/css" href="../Pub/Css/JQ/aptabs.css" />
</head>
<body style="overflow: hidden; margin: 4px 4px 0px 4px; background-color: #ffffff; ">
    <form id="form1" runat="server">
        <div style="border: solid 1px LightSkyBlue; background-color: White; padding: 2px">
            <table cellspacing="0" cellpadding="0" border="0" width="100%">
                <tbody>
                    <tr>
                        <td style="text-align: left; vertical-align: top; background-image: url(../Images/Body/background-web_wow_box.jpg);
                            padding: 0; width: 180px; background-repeat: repeat-y" id="LeftBody" valign="top">
                            <asp:Label ID="Label1" runat="server" Text="" Font-Size="10pt" Font-Names="Tahoma"
                                Font-Bold="True"></asp:Label>
                            <img border="0" src="../Images/Icon/welcome-icon.jpg"
                                style="vertical-align: top; text-align: left" />
                            <asp:Label ID="lblLoginName" runat="server" Font-Size="12px" Font-Names="tahoma" style="vertical-align:bottom"
                                ForeColor="DimGray" Font-Bold="true"></asp:Label>
                            <asp:LinkButton ID="LinkButton1" OnClick="LinkButton1_Click" runat="server" Font-Size="7pt"
                                Font-Names="Verdana" Font-Bold="True" ForeColor="Purple" Font-Italic="True"><img src="../Images/Icon/gnome_session_logout.png" style="vertical-align: bottom;
                                text-align: right"  border="0"/></asp:LinkButton>
                            <div style="overflow: auto; width: 180px;" id="divTreeMenuMain">
                                <asp:TreeView ID="tvwmenu" runat="server" Font-Size="8pt" Font-Names="Verdana" NodeIndent="15"
                                    AutoGenerateDataBindings="False" Width="100%" ShowLines="True" ImageSet="XPFileExplorer">
                                    <ParentNodeStyle Font-Bold="False" />
                                    <HoverNodeStyle Font-Underline="True" ForeColor="#6666AA" />
                                    <SelectedNodeStyle Font-Underline="True" HorizontalPadding="0px" VerticalPadding="0px"
                                        BackColor="#B5B5B5" />
                                    <NodeStyle CssClass="TextMenuRoot" HorizontalPadding="5px" NodeSpacing="0px" VerticalPadding="0px"
                                        Font-Bold="False" />
                                    <RootNodeStyle Font-Bold="True" CssClass="TextMenuRoot" />
                                    <LeafNodeStyle Font-Bold="False" CssClass="TextMenuRoot" />
                                </asp:TreeView>
                            </div>
                        </td>
                        <td style="background-image: url('../Images/Icon/cs.jpg'); background-repeat: repeat-y;
                            display: none; background-color: white; background-position: center; width: 7px;
                            text-align: center; height: 100%" align="right">
                            <img border="0" onclick="fnOnFix(this)" src="../Images/Icon/fixup.gif" style="cursor: pointer;
                                top: 10px; position: absolute;" />
                            <img src="../Images/Icon/arrow_left.gif" border="0" onclick="FixToolBar(this)" id="imgArrow"
                                style="cursor: pointer;" />
                        </td>
                        <td style="text-align: left; vertical-align: top; padding-left: 3px" id="tdTab">
                            <div id="apTabs" class="apTabs" style='width: 800px; height: 600px; margin: 0px auto;
                                text-align: left'>
                                <!--  <h5 class="noclose">
                                    Home Admin</h5>
                                <div>
                                    <div class="loadingAdmin">
                                    </div>
                                    <iframe width="100%" height="500px" margin="0" padding="0" frameborder="0"  id="ifTab0">
                                    </iframe>
                                </div>-->
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
        <input type="hidden" id="hidleft" value="1" />
    </form>

    <script language="javascript" type="text/javascript">     
 
   function FixToolBar(obj)
   {
        var hidleft=document.getElementById("hidleft");
        var tdMainLeft=parent.document.getElementById("fParent");   
   
    
        if(hidleft.value=="1")
        {
            hidleft.value="0";

            document.getElementById("LeftBody").style.display="none"
            obj.src="../Images/Icon/arrow_right.gif";       
                 
        }
        else
        {
             hidleft.value="1";
             document.getElementById("LeftBody").style.display="block"       
             obj.src="../Images/Icon/arrow_left.gif";
        }
        
   }
   
    try{
     SetWindow();  
     }catch(e){}
     
   
          jQuery(window).load(function($) {         
             openURL("Home Admin","SummaryHome.aspx",true)       ;
            });
      var heightTab,widthTab;   
     function SetWindow()
     {
     
        
         jQuery(document).ready(function($) {
         
            $(".tabsContent:last div iframe").load(function (){
                    $(".loadingAdmin").last().remove();
             });
            ////
            $height=$(window).height();
            $("#divTreeMenuMain").css("height",$height-35+"px");
           //heightTab= $("#tdTab").height();
           widthTab=$("#tdTab").width();  
        
           if($.browser.msie)
           {
                if(parseInt($.browser.version)==7)
                    widthTab=widthTab-3;
                else
                    widthTab=widthTab-200;   
           }
           else
                 widthTab=widthTab-5;
          heightTab=$height-20;
          $("#apTabs").css("height",heightTab); 
          $("#apTabs").css("width",widthTab); 
          
        });      
     }    
    
    function openURL(name,url,noclose)
    {        
          
          for(i=0;i<getElementsByClassName("tabLabelLeft").length;i++)  
          {
                if(name.trim()==getElementsByClassName("tabLabelLeft")[i].innerHTML.trim()) 
                {
                    apTabs.show('apTabs', i+1);           
                    return false
                } 
          }      
         
         /*
          $(".tabLabelLeft").each(
                     function(index, obj)
                       {                        
                            if(name.trim()==$(this).html().trim()) 
                            {
                                apTabs.show($(this), index);           
                           
                            } 
                       }
                );
         */   
           
            
          jQuery(document).ready(function($) {    
            if(noclose)         
                apTabs.add('apTabs', {title: name, iframe: url,close:false});
            else
                 apTabs.add('apTabs', {title: name, iframe: url,close:true});
                 
               $(".tabsContent:last div iframe").attr("width",widthTab-10);
               $(".tabsContent:last div iframe").attr("height",heightTab-29);
               $(".tabsContent:last div iframe").load(function (){
                    $(".loadingAdmin").last().remove();
                });
               
          });   
       

      /* apTabs.add('apTabs', {title: name, iframe: url});           
       getElementsByClassName("loadingAdmin")[getElementsByClassName("tabLabelLeft").length-1].style.display="none";
            */
    }
    
     function getElementsByClassName(classname, node) {
        if(!node) node = document.getElementsByTagName("body")[0];
        var a = [];
        var re = new RegExp('\\b' + classname + '\\b');
        var els = node.getElementsByTagName("*");
        for(var i=0,j=els.length; i<j; i++)
        if(re.test(els[i].className))a.push(els[i]);
        return a;
    }
    String.prototype.trim = function () {
		return this.replace(/^\s*/, "").replace(/\s*$/, "");
	}
              
               //  alert(document.getElementById("tdTab").clientWidth);  
                /*var  apTabs=document.getElementById("apTabs");
                apTabs.defaultWidth=document.getElementById("tdTab").clientWidth-300+"px";
               alert(apTabs.defaultWidth) ;*/
               
                    
    </script>

</body>
</html>
